<template>
  <a-modal
    :visible="visible"
    title="未修课程列表"
    :width = "700"
    style="top: 20px;"
    @cancel="() => { $emit('cancel') }"
    @ok="() => { $emit('cancel') }"
  >
    <a-table
      :columns="columns"
      :dataSource="list"
      size="middle"
      :pagination="false"
      :loading="loading"
      :scroll="{ y: 240 }"
    >
      <span slot="serial" slot-scope="text, record, index">
        {{ index + 1 }}
      </span>
    </a-table>
    <a-button slot="footer" type="primary" @click="() => { $emit('cancel') }">关闭</a-button>
  </a-modal>

</template>

<script>
import { STable } from '~'

export default {
  props: ['visible', 'list'],
  data () {
    return {
      columns: [
        {
          title: '序号',
          width: 60,
          scopedSlots: { customRender: 'serial' }
        },
        {
          title: '课程代码',
          width: 100,
          dataIndex: 'kcdm'
        },
        {
          title: '课程名称',
          dataIndex: 'kcmc'
        },
        {
          title: '课程类型',
          width: 90,
          dataIndex: 'kclxmc'
        },
        {
          title: '修课类型',
          width: 90,
          dataIndex: 'bxhxxmc'
        },
        {
          title: '考试状态',
          width: 90,
          dataIndex: 'ksztmc'
        },
        {
          title: '修课状态',
          width: 90,
          dataIndex: 'xkztmc'
        },
      ],
      loading: false
    }
  }
}
</script>

<style>
</style>
